<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){

	$("#member_question_upload_button").click(function(){
		if($("#ques").val() ==""){
			alert('questions is empty');
		}
		else if($("#ans").val() ==""){
			alert('answer is empty');
		}
		else
		{	
			$("#member_question_upload_form").submit();
		}
	});
});  
</script>
<h1 align="center">Upload questions</h1>
	<form action="" method="post" id="member_question_upload_form">
    <table align="center">
    	 <tr>
        	<td>questions</td>
            <td><input type="text" name="questions" value="" id="ques"/>
            <?php echo form_error('questions');?></td>
        </tr>
        <tr>
        	<td>answers:</td>
            <td><textarea name="answers" cols="20" rows="4" id="ans"></textarea>
            <?php echo form_error('answers');?></td>
        </tr>        
           
        <tr>
        	<td colspan="2" align="right"><button type="button" id="member_question_upload_button">submit</button></td>
        </tr>        
     </table>
    </form>
    <?php if($this->session->userdata('qus_upload_sucess_message')){ echo "<h1 align='center'>".$this->session->userdata('qus_upload_sucess_message')."</h1>"; $this->session->unset_userdata('qus_upload_sucess_message'); } ?>



</head>
<body>
</html>